<?php
/**
 * Created by PhpStorm.
 * User: zlkmu
 * Date: 2017/10/4
 * Time: 17:02
 * 表示房间的类，是所有各种房间的基类
 */
    class Room{
        protected $roomID;        //房间ID
        protected $roomType;      //房间类型, 参考Context的RoomType
        protected $playerList=array();    //玩家队列，存储的为用户的UID
        protected $isBegin;            //是否开始

        //所有类型共有的属性（通比牛牛没有闲家推注 底分只有1/2/4）
        protected $endPoints;        //底分(数组)(1,2)(2,4)(4,8)
        protected $totalCount;       //房间总盘数
        protected $currentRound;     //当前盘数
        protected $roomRatePayment;  //房费支付方式 房主支付(局数*0.3) AA支付(局数*0.1)
        protected $doubleRules;      //翻倍规则 (牛牛*3 牛九*2 牛八*2) (牛牛*4 牛九*3 牛八*2 牛七*2)
        protected $specialCardType;  //特殊牌型数组【复选】 (五花牛5倍)(炸弹牛6倍)(五小牛8倍)
        protected $pushNote;         //闲家推注(无 5倍 10倍 20倍)
        protected $advancedOptions;  //高级选项数组【复选】 (游戏开始后禁止加入)(禁止搓牌)

        //固定庄家
        protected $onVillageScore;   //上庄分数（无 100 150 200）

        //明牌抢庄
        protected $biggestRob;      //最大抢庄(1倍 2倍 3倍 4倍)


        protected $dissolveCount = 1; //同意解散房间人数数量
        protected $refuseDissolve = 0; //拒绝解散房间人数数量
        protected $isDissolve;       //是否解散房间

        /**
         * @return
         */
        public function getRoomID()
        {
            return $this->roomID;
        }

        /**
         * @param $roomID
         */
        public function setRoomID($roomID)
        {
            $this->roomID = $roomID;
        }


        /**
         * @return
         */
        public function getRoomType()
        {
            return $this->roomType;
        }

        /**
         * @param $roomType
         */
        public function setRoomType($roomType)
        {
            $this->roomType = $roomType;
        }

        /**
         * @return mixed
         */
        public function getPlayerList()
        {
            return $this->playerList;
        }

        /**
         * 获取房间人数
         */
        public function getPlayerNum(){
            return count($this->playerList);
        }

        /**
         * 添加玩家到房间
         * @param $userUid
         */
        public function addPlayerToList($userUid)
        {

            foreach($this->playerList as $p){
                if($p==$userUid){
                    return;
                }
            }

            array_push($this->playerList,$userUid);
        }




    }





?>